package cn.jjxx.core.config;

/**
 * @Title: BillConfig.java .<br>
 * @Package cn.jjxx.core.config .<br>
 * @Description: 单据枚举类型配置 .<br>
 * @author 郑成功 .<br>
 * @email a876459952@qq.com .<br>
 * @date 2018-2-26 上午10:58:45.<br>
 * @version V1.0.<br>
 */
public class BillConfig {
	
	public static final int SAVE = 0;//保存
	public static final int SUBMIT = 1;//已提交
	public static final int REVIEWING = 2;//审核中
	public static final int REVIEW = 3;//已审核
	public static final int BEATBACK = 5;//打回
	public static final int DELETE = -1;//删除
	
	public static final int DISABLED = 0;//禁用
	public static final int ENABLED = 1;//启用

	/**
	 * @Title: BillConfig.java .<br>
	 * @Package cn.jjxx.core.config .<br>
	 * @Description: 单据操作的枚举类型 .<br>
	 * @author 郑成功 .<br>
	 * @email a876459952@qq.com .<br>
	 * @date 2018-2-26 上午10:57:39.<br>
	 * @version V1.0.<br>
	 */
	public enum operateType{
		SAVE,SUBMIT,BEATBACK,REVIEWING,REVIEW,UNREVIEW,DELETE
	}
	
	/**
	 * @Title: BillConfig.java .<br>
	 * @Package cn.jjxx.core.config .<br>
	 * @Description: 单据操作的枚举类型 .<br>
	 * @author 郑成功 .<br>
	 * @email a876459952@qq.com .<br>
	 * @date 2018-2-26 上午10:57:39.<br>
	 * @version V1.0.<br>
	 */
	public enum operate{
		保存,提交,审核,反审核,打回,删除,同意,不同意
	}
	/**
	 * @Title: BillConfig.java .<br>
	 * @Package cn.jjxx.core.config .<br>
	 * @Description: 状态中文转换 .<br>
	 * @author 郑成功 .<br>
	 * @email a876459952@qq.com .<br>
	 * @date 2018-5-23 下午6:21:04.<br>
	 * @version V1.0.<br>
	 */
	public enum statusName{
		保存,已提交,审核中,已审核,打回
	}
	
	/**
	 * @Description: 传入操作状态，得到操作类型 .<br>
	 * @param type 操作类型.<br>
	 * @return String .<br> 
	 * @author 郑成功 .<br>
	 * @date 2018-2-26 上午10:58:02.<br>
	 */
	public static String billStatus(int type){
		String optType = operateType.SAVE.toString();
		switch (type) {
			case 0:
				optType = operateType.SAVE.toString();
				break;
			case 1:
				optType = operateType.SUBMIT.toString();
				break;
			case 2:
				optType = operateType.REVIEW.toString();
				break;
			case 3:
				optType = operateType.UNREVIEW.toString();
				break;
			case 5:
				optType = operateType.BEATBACK.toString();
				break;
			case -1:
				optType = operateType.DELETE.toString();
				break;
		}
		return optType;
	}
	
	/**
	 * @Description: 根据状态转换成名称 .<br>
	 * @param status 状态.<br>
	 * @author 郑成功 .<br>
	 * @date 2018-5-23 下午6:24:27.<br>
	 */
	public static String billStatusName(int status){
		String sName = statusName.保存.toString();
		switch (status) {
			case 0:
				sName = statusName.保存.toString();
				break;
			case 1:
				sName = statusName.已提交.toString();
				break;
			case 2:
				sName = statusName.审核中.toString();
				break;
			case 3:
				sName = statusName.已审核.toString();
				break;
			case 5:
				sName = statusName.打回.toString();
				break;
		}
		return sName;
	}
}
